package com.cunfang.util;

import java.util.Scanner;

public class test {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int count = Integer.parseInt(sc.nextLine());
		String[] inputs = new String[count];
		int i = 0;
		while (i < count) {
			inputs[i++] = sc.nextLine();
		}
		sc.close();
		for (String str : inputs) {
			System.out.println(handle(str));
		}
	}

	private static String handle(String str) {
		if (str == null || "".equals(str.trim())) {
			return "NO";
		}

		String numStr = str.substring(2);
		int[] nums = new int[numStr.length()];
		for (int i = 0; i < nums.length; i++) {
			nums[i] = Integer.valueOf(numStr.charAt(i) + "");
		}
		StringBuffer sb = new StringBuffer();

		int times = numStr.length();

		sb.append("0.");
		while (times-- > 0) {
			int ret = 0;
			int mTime = times;
			while (mTime >= 0) {
				ret += nums[mTime] * 2;
				nums[mTime] = ret % 10;
				ret /= 10;
				mTime--;
			}
			sb.append(ret);
		}
		for (int i : nums) {
			if (i != 0)
				return "NO";
		}
		return sb.toString();
	}
}
